Skip to main content

7-Complete example

7- Complete example​

What is a Gradient?​

Gradient is simply relationship of weight and loss.

if Increasing w tends to increase loss -> negative gradient. -> we need to decrease weight

if Increasing w tends to decrease loss -> positive gradient -> we need to increase weight

Calculating Gradients Manually​

Let's calculate the exact gradient of our loss function and use it to update the weight and bias. parameternew​=parameter−learning rate×gradient

Gradient Descent (Weight and Bias Updation)

Why does this work?​

By calculating the derivatives (`dw` and `db`), we figure out exactly how a tiny change in `w` or `b` affects the overall loss. Multiplying these gradients by a small learning rate ensures we take careful, controlled steps towards the minimum possible error!